package com.woniu.userservice.dao;

import com.woniu.userservice.entity.Collections;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface CollectionsDao {
    Collections queryById(Integer id);

    List<Collections> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
    
    List<Collections> findAll();

    List<Collections> queryAll(Collections collections);

    int insert(Collections collections);

    int update(Collections collections);

    int deleteById(Integer id);

    /**
     *
     * @param id 商品
     * @param userid 用户
     * @return 取消收藏
     */
    @Delete("delete  from collections where id = #{id} and userId = #{userId} ")
    Boolean deleteByShopId(@Param("id")Integer id, @Param("userId") Integer userid);

    List<Collections> findByShop(@Param("userId") Integer userId, @Param("goodsName") String goodsName, @Param("collectionTime") Date collectionTime, @Param("price") Double price);
}